class SoftwareIdea { 
    String about
    String description
    String permalink
    Date createdOn = new Date()

    static belongsTo = [byUser:User]
    static hasMany  =  [comments:Comment,votes:Vote,features:Feature,tags:Tag,implementationProjects:ExistingProject]

	static constraints = {
		about(maxSize:50, blank:false)
		description(maxSize:4000, blank:false)
	}
	
	def rating() {
		def result = 0
		votes.each {
			result += it.value
		}
		return result
	}
}	
